package com.koron.css2.serviceManage.service;

import com.koron.css2.serviceManage.bean.ServiceUserBean;
import com.koron.css2.serviceManage.mapper.ServiceUserMapper;
import com.koron.css2.serviceManage.utils.CommonUtils;
import org.koron.ebs.mybatis.SessionFactory;
import org.koron.ebs.mybatis.TaskAnnotation;
import org.springframework.stereotype.Service;

/**
* @author 作者
* @version 创建时间：2018年7月19日 上午11:44:04
* 类说明
*/
@Service
public class ServiceUserService {

	/**
	 * 运维人员登录
	 * @param sessionFactory
	 * @param serviceUserBean
	 * @return
	 * @throws Exception
	 */
	@TaskAnnotation("selectByLoginName")
	public ServiceUserBean selectByLoginName(SessionFactory sessionFactory, ServiceUserBean serviceUserBean) throws Exception {
		ServiceUserMapper mapper = sessionFactory.getMapper(ServiceUserMapper.class);
		ServiceUserBean sysUserBean = mapper.selectByLoginName(serviceUserBean);
		return sysUserBean;
	}
	
	@TaskAnnotation("loginLog")
	public void loginLog(SessionFactory factory, String staff, Integer type, String description, String module) throws Exception {
		CommonUtils.addLog(factory, staff,type,description,module);
	}
	
}
